import React, { useState } from 'react';
import { Tabs } from 'antd';

const [activeKey, setActiveKey] = useState('1');

const onChangeTabs = (key: string) => {
  console.log(key);
  setActiveKey(key);
  // history.replace({
  //   pathname: 'ApiManageDetaile',
  //   query: {
  //     id: id,
  //     name: name,
  //     page: key,
  //     projectId,
  //   },
  // });
  // history.goBack()
  // history.push({
  //   pathname: 'AddDataIndex',
  //   query: {
  //     isEdit: true,
  //     key: selectKey, // 左边的目录id，命名应该统一，
  //     projectId,
  //     itemp,
  //   },
  // });
};

const App: React.FC = () => (
  <>
    <Tabs tabPosition="left" centered activeKey={activeKey} onChange={onChangeTabs}>
      <Tabs.TabPane tab={'数据存储设置'} key="1">
        <div>自动填写数据</div>
      </Tabs.TabPane>
      <Tabs.TabPane tab={'填写规则设置'} key="2">
        22
      </Tabs.TabPane>
      <Tabs.TabPane tab={'消息提醒'} key="3">
        556
      </Tabs.TabPane>
      <Tabs.TabPane tab={'审批流程'} key="4">
        99
      </Tabs.TabPane>
    </Tabs>
  </>
);

export default App;
